import pandas as pd
import werkzeug

from flask_restful import reqparse

from ext import *
from kitool.ConfigKit import read_conf_info
from kitool.NlpKit import valid_excel_to_gen_md_by_api


class AppController(Resource):
    # post
    def post(self):
        jsonDict = request.get_json()
        print(jsonDict)
        return ok(1)



class AppRevalidGenMarkdownController(Resource):
    # post
    def post(self):
        excel = request.files['excel']
        res_dict = {}
        if excel:
            df = pd.read_excel(excel)
            valid_excel_to_gen_md_by_api(df, read_conf_info)
        return ok(res_dict)